import type { AppRouteRecordRaw } from '../types';
import { REDIRECT_NAME, EXCEPTION_COMPONENT, PAGE_NOT_FOUND_NAME, LAYOUT } from '../constant';

// 404 on a page
// export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
// 	path: '/:path(.*)*',
// 	name: PAGE_NOT_FOUND_NAME,
// 	component: EXCEPTION_COMPONENT,
// 	meta: {
// 		title: 'ErrorPage',
// 		hideBreadcrumb: true,
// 		hideMenu: true,
// 	},
// };

// export const REDIRECT_ROUTE: AppRouteRecordRaw = {
// 	path: '/redirect/:path(.*)',
// 	component: () => import('@/views/redirect/index.vue'),
// 	name: REDIRECT_NAME,
// 	meta: {
// 		title: REDIRECT_NAME,
// 		hideBreadcrumb: true,
// 		hideMenu: true,
// 	},
// };

export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
	path: '/:path(.*)*',
	name: PAGE_NOT_FOUND_NAME,
	component: LAYOUT,
	meta: {
		title: 'ErrorPage',
		hideBreadcrumb: true,
		hideMenu: true,
	},
	children: [
		{
			path: '/:path(.*)*',
			name: PAGE_NOT_FOUND_NAME,
			component: EXCEPTION_COMPONENT,
			meta: {
				title: 'ErrorPage',
				hideBreadcrumb: true,
				hideMenu: true,
			},
		},
	],
};

export const REDIRECT_ROUTE: AppRouteRecordRaw = {
	path: '/redirect',
	component: LAYOUT,
	name: 'RedirectTo',
	meta: {
		title: REDIRECT_NAME,
		hideBreadcrumb: true,
		hideMenu: true,
	},
	children: [
		{
			path: '/redirect/:path(.*)',
			name: REDIRECT_NAME,
			component: () => import('@/views/redirect/index.vue'),
			meta: {
				title: REDIRECT_NAME,
				hideBreadcrumb: true,
			},
		},
	],
};
